package com.stephen.redisdemo;

/**
 * @author: stephen
 * @create: 2020-02-27 10:07
 * @description: 静态内部类的方式创建单例模式
 */
public class HoldSingleton {

    private HoldSingleton() {

    }


    private static class Holder {
        private static final HoldSingleton sInstance = new HoldSingleton();
    }

    public static HoldSingleton getInstance() {
        return Holder.sInstance;
    }

}
